<template>
  <div>
    <div>
      <MySubject
        v-for="(item, index) in arr"
        :key="index"
        :obj="item"
        @tijiao="item.res = $event"
      ></MySubject>
    </div>
    <div>
      <MyFlag
        v-for="(item, index) in arr"
        :key="index"
        :obj="item"
        :index="index"
      ></MyFlag>
    </div>
  </div>
</template>

<script>
import MySubject from "./components/MySubject.vue";
import MyFlag from "./components/MyFlag.vue";
export default {
  components: {
    MySubject,
    MyFlag,
  },
  props: {},
  data() {
    return {
      arr: [],
    };
  },
  computed: {},
  watch: {},
  created() {
    const arr = [];
    for (let i = 0; i < 5; i++) {
      const left = Math.floor(Math.random() * 11);
      const rigth = Math.floor(Math.random() * 11);
      arr.push({ left, rigth, res: "" });
    }
    this.arr = arr;
  },
  methods: {},
};
</script>

<style scoped></style>
